//
//  HomeGropModel.swift
//  XiaoJingMallSwift
//
//  Created by beisheng03 on 2017/7/21.
//  Copyright © 2017年 beisheng. All rights reserved.
//

import UIKit

class HomeGropModel: NSObject {
    
    var item_data : HomeOneGroup?
    
    var type = ""
    
    init(dic : [String : AnyObject]) {
        super.init()
        
        setValuesForKeys(dic)
        
    }
    
   
    
    override func  setValue(_ value: Any?, forKey key: String) {
        
        if key == "item_data" {
            
            if let temp = value as? [String : AnyObject]{
                
                item_data = HomeOneGroup(dic:temp )
                
            }
            
        } else {
        
            
            super.setValue(value, forKey: key)
        }

    }
    
    override func setValue(_ value: Any?, forUndefinedKey key: String) {
        
        
    }
    
    
    //在swift中想要打印对象要以下重写属性
    override var description: String{
        let keys = ["item_data","type"]
        let dic = dictionaryWithValues(forKeys: keys)
        return "\(dic)"
    }
    


}
